#pragma comment(linker, "/entry:test")  
#define TEST
#include "iostream"
#include "test.h"

int test() {
    int caseCount = sizeof(CASES) / sizeof(CASES[0]);
    for (int i = 0; i < caseCount; ++i) {
        g_input = CASES[i].input;
        main();
        if (strcmp(g_output.c_str(), CASES[i].output) != 0) {
            std::cout << "failed at case:" << i << ". out:" << g_output <<  std::endl;
            return -1;
        }
    }
    std::cout << "all "<< caseCount << " cases passed" << std::endl;
    return 0;
}